home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11845 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.6 KB

  1. Path: mpro1.mpro.net!news
  2. From: larry@pronet.mpro.net (Larry Motylinski)
  3. Newsgroups: comp.os.linux.misc,comp.lang.c,comp.unix.admin,comp.security.unix
  4. Subject: Re: binaries (generated from "C" code)
  5. Date: Wed, 27 Mar 1996 00:10:08 GMT
  6. Organization: Prophet Systems
  7. Message-ID: <4ja11e$e1m@mpro1.mpro.net>
  8. References: <4j7pge$9ga@xanadu.io.com> <hendersoDovvs3.20G@netcom.com>
  9. Reply-To: larry@pronet.mpro.net
  10. NNTP-Posting-Host: isdn1.mpro.net
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. henderso@netcom.com (Mark C. Henderson) wrote:
  14.  
  15. >In article <4j7pge$9ga@xanadu.io.com>, Casey Claiborne <mskc@io.com> wrote:
  16. >>Hello,
  17. >>    I have a question that I am hoping someone out there can
  18. >>help me with. I have a binary that was generated using "C" code.
  19. >>Is there any way that I can ensure that the binary generated will
  20. >>run on one machine? I have heard that some vendors use licensing
  21. >>but I am not exactly sure how this works. Any advice, help or
  22. >>hints on the matter would be *greatly* appreciated :)
  23.  
  24. >Well, the trick is to have some sort of key based upon a unique identifier
  25. >for the machine. Most commercial UNIX systems give you a call to get
  26. >some sort of serial number which, in theory, is unique to the machine.
  27.  
  28. >One simple way to do this is to build yourself a hash function based
  29. >upon MD5, SHS, or something similar. Then make a licence file with
  30. >the serial number and the hash.
  31.  
  32. >e.g.
  33. >123456912     CB5870B1FBA4E4E24392
  34.  
  35. >The program can check the serial number of the machine it is running on,
  36. >calculate the hash, and validate the key.
  37.  
  38. >Of course, this is completely insecure. Folks can just modify the binary
  39. >so that the licence checker is not called. Worse, they can generate
  40. >a valid key by spying on the program with a debugger. But the expensive
  41. >commercial schemes generally also have these flaws. You also need to
  42. >trust the operating system (something not under the programs control)
  43. >to report the correct serial number. This assumption can be fatal
  44. >(e.g. see http://www.squirrel.com/squirrel/sun-stuff/change-sun-hostid.tar.gz
  45. >for Sun/Solaris examples which allow you to alter this serial number as 
  46. >reported by the OS).
  47.  
  48. >Of course, you could do a lot better. Perhaps use an encryption function
  49. >to generate the key, and don't embed it in the code for the binary. This
  50. >way our cracker has to try to reverse your decryption function. Also
  51. >initialise a few critical constants in your licence verification routine. 
  52. >This way, if someone tries to bypass it, the program will malfunction.
  53.  
  54. >See, 
  55. >ftp://utopia.hacktic.nl/pub/replay/pub/cracking/license.asc.gz
  56. >for some information on how to make such a scheme harder to crack.
  57.  
  58. >There are no guarantees, but if you are willing to put some work into
  59. >making this sort of thing more secure, you can, at least, make it so that
  60. >the potential crackers has a few hours of work ahead of him/her.
  61.  
  62. >The other alternative is to go with a dongle. People also have ways of
  63. >getting around them, and they are generally very annoying, especially if
  64. >your customer has to use more than one.
  65.  
  66. What I used to do is read the CMOS and other eproms (looking for a
  67. serial number or something that made it unique) and then encrypt that
  68. code in a program.  The program (when run) would verify this
  69. information.  It kinda sucks because you will be the one to get a call
  70. if they change their hardware.  I used to use the lower memory block
  71. in dos to see what hardware they had and build that into the program
  72. also.  Another trick I used to use was using tracks on a floppy that
  73. didn't technically exist (track 81) and that only worked with very
  74. low-level programming (I used assembler to access the track).
  75.  
  76. Hope this helps
  77.  
  78.